From ef56e60ddf9e57bcdbe121206b79efaa5b7c8f5f Mon Sep 17 00:00:00 2001 From: oliskoli Date: Tue, 20 Feb 2007 21:02:10 +0000 Subject: [PATCH] Add some (safety) code for a consistent behaviour of queue pointers. --- queue.c | 2 ++ waypt.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/queue.c b/queue.c index 1c0b54d65..3e8181159 100644 --- a/queue.c +++ b/queue.c @@ -39,6 +39,8 @@ dequeue(queue *element) next->prev = prev; prev->next = next; + + QUEUE_INIT(element); return element; } diff --git a/waypt.c b/waypt.c index 57985ed22..f58179c77 100644 --- a/waypt.c +++ b/waypt.c @@ -75,7 +75,7 @@ waypt_dupe(const waypoint *wpt) * It's important that this duplicated waypoint not appear * on the master Q. */ - tmp->Q.next = tmp->Q.prev = NULL; + QUEUE_INIT(&tmp->Q); tmp->fs = fs_chain_copy( wpt->fs ); return tmp; @@ -145,6 +145,7 @@ waypt_new(void) wpt->fix = fix_unknown; wpt->sat = -1; + QUEUE_INIT(&wpt->Q); return wpt; } -- 2.30.2